addspriteaction

Adds a sprite action to the given sprite group in the Compose user interface. addspriteaction is only available in the Compose GUI.

Syntax

addspriteaction(sagname, label, name, callback, icon, tooltip, mask, enabled)

Inputs

sagname
The name of the sprite action group.
Type: string
label
The label of the sprite action; must be unique.
Type: string
name
The name of the sprite action.
Type: string
callback
The name of the callback function, which gets called when the action is clicked.
Type: string
icon
The PNG strip image of the sprite action.
Type: string
tooltip
The action item's tooltip.
Type: string
mask
pic mask from the icon strip.
Type: string
enabled
Boolean flag to enable or disable action at the time of creation.
Type: Boolean

Outputs

uiSpriteAction
The handle to the sprite action.

Examples

Add a sprite action item to the given sprite group:
addribbonpagegroup('Test','Indentation');
addspriteactiongroup('Test', 'Indentation', 'TestSG', 'UnIndent',0,80);
movesprite('TestSG', 0, -5);
addspriteaction('TestSG', 'TestActionLabel','TestAction', 'HandleUnIndent', 'UnIndent-80.png','','',true);

function HandleUnIndent()
	disp('Unindent is handled');
end